#ifndef _codekata_statistics_h_
#define _codekata_statistics_h_

#include "pub_inc/pub.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef int StatHandle;
typedef struct {
    char name[32];
} StatName;
typedef BEST_STATUS (*StatEchoFunc)(StatName name, int cnt);

typedef struct {
    StatHandle handle;
    StatName   name;
    int        cnt;
    int        haveUse;
} StatHandleWithName;

BEST_STATUS StatInit(StatHandle *handle, StatName name);
BEST_STATUS StatAdd(StatHandle handle, int cnt);
BEST_STATUS StatGet(StatHandle handle, int *cnt);
BEST_STATUS StatEcho(StatHandle handle, StatEchoFunc fn);
BEST_STATUS StatEchoAll(StatEchoFunc fn);

#ifdef __cplusplus
}
#endif
#endif
